﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Home/Layouts/Home.Master" AutoEventWireup="true"
    CodeBehind="NewsDetail.aspx.cs" Inherits="MLM.Home.Pages.NewsDetail" %>

<%@ Import Namespace="MLM.Home" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:FormView runat="server" DataSourceID="NewsEds">
        <ItemTemplate>
            <h3 class="main_title">
                <%#Eval("Title") %>
            </h3>
            <div class="main_content">
                <div id="newsdetail_wrapper">
                    <%#Eval("Detail") %>
                </div>
            </div>
        </ItemTemplate>
    </asp:FormView>
    <asp:EntityDataSource ID="NewsEds" runat="server" ConnectionString="name=MLMDataContext"
        AutoGenerateWhereClause="True" DefaultContainerName="MLMDataContext" EntitySetName="FrontEndNews">
        <WhereParameters>
            <asp:RouteParameter runat="server" Type="Int32" RouteKey="id" Name="Id" />
        </WhereParameters>
    </asp:EntityDataSource>
    <h4 class="othernews_title">
        Orther news</h4>
    <div class="orthernews_content">
        <asp:Repeater runat="server" DataSourceID="OrtherNewsEds">
            <ItemTemplate>
                <a href='<%#Eval("ID").LinkItemDetailShort(Eval("Title"),"ReadNews") %>'>
                    <%#Eval("Title") %></a><br />
            </ItemTemplate>
        </asp:Repeater>
        <asp:EntityDataSource ID="OrtherNewsEds" runat="server" ConnectionString="name=MLMDataContext"
            DefaultContainerName="MLMDataContext" EntitySetName="FrontEndNews" Where="it.Id != @CurrentNewsId">
            <WhereParameters>
                <asp:RouteParameter Name="CurrentNewsId" Type="Int32" RouteKey="id" />
            </WhereParameters>
        </asp:EntityDataSource>
    </div>
</asp:Content>
